
$(function()
{
	'use strict';
	layui.use('element', function(){
			var element = layui.element;
		});
	$("#banner-feature").click(function () {
	$('body,html').animate({scrollTop: $('#feature').offset().top}, 600);
	});
	$("#banner-download").click(function () {
	$('body,html').animate({scrollTop: $('#download').offset().top}, 1000);
	});
	$("#banner-joinus").click(function () {
	$('body,html').animate({scrollTop: $('#joinus').offset().top}, 1000);
	});
	$(".mystory").click(function () {
		$('.video').show();
	});
	$(".close").click(function () {
		$('.video').hide();
	});
	$(".job-items .job-item").click(function() {
        $(this).siblings('div').removeClass('select');  // 删除其他兄弟元素的样式
        $(this).addClass('select');                            // 添加当前元素的样式
		$(".select .request").toggle('fast');
    });
		
	var x = document.getElementById("shiping");
	$('.close').click(function(){
	x.pause();
	});
	$('.mystory').click(function(){
		x.play();
	});
	
	$(".android").click(function(){
	
	window.location.href='https://mangxing.oss-cn-hangzhou.aliyuncs.com/apk/mangxing.apk';
});
	$(".iphone").click(function(){
		window.open('https://www.apple.com/cn/ios/app-store/');
});
	var sidebar=$('#sidebar'),
	 mask=$('.mask'),
	 backButton=$('.backtop'),
	 sidebar_trigger=$('#sidebar_trigger');
	function showSideBar(){
		mask.fadeIn();
		sidebar.css('right',0);
	}
	function hideSideBar(){
		mask.fadeOut();
		sidebar.css('right',-sidebar.width());
	}
	sidebar_trigger.on('click',showSideBar)
	mask.on('click',hideSideBar)
	backButton.on('click',function()
	{
		$('html,body').animate({
			scrollTop:0
		},800)
		
	})
	$(window).on('scroll',function(){
		if($(window).scrollTop()>$(window).height())
		backButton.fadeIn();
		else
		backButton.fadeOut();
	})
	$(window).trigger('scroll');
})
